using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using System.Resources;
using System.Globalization;
using System.Reflection;

namespace NBusiness.Utilities
{
    public class ResourceDescriptionAttribute : DescriptionAttribute
    {
        private ResourceManager _manager;
        private string _resourceName;

        public override string Description
        {
            get
            {
                return _manager.GetString(_resourceName, CultureInfo.CurrentCulture);
            }
        }

        public ResourceDescriptionAttribute(string resourceName, string resourceClassName)
        {
            _resourceName = resourceName;
            _manager = new ResourceManager(resourceClassName, Assembly.GetCallingAssembly());
        }
    }
}
